classdef HammingLoss < MultiLabelMetric
    %HAMMINGLOSS Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
    end
    
    methods
        function [ this ] = HammingLoss(  )
            if nargin == 0
                this.setName('hamming_loss');
                return
            end
        end
    end
    
    methods
        function [ result ] = apply( this, Y, Y_hat, Y_out )
            assert(isequal(this.name, 'hamming_loss'));
            result = HammingLoss.calc(Y, Y_hat);
        end
    end
    
    methods ( Static = true )
        function [ result ] = calc( Y, Y_hat, Y_out )
            result = nnz(Y ~= Y_hat)/numel(Y);
            result = -result;
        end
    end
    
end

